]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
AppDisplay: fix isTerminal() check for apps without categories
authorGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 13 Jan 2014 22:02:06 +0000 (23:02 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 13 Jan 2014 22:13:28 +0000 (23:13 +0100)
If there is no Categories line in the .desktop file, get_categories()
returns null, not an empty array.

js/ui/appDisplay.js

index 049b339fffafe0a3e051d3d5910a586e9651b01e..2f5465b662b8780c119eea881fb6fa1cdca4c429 100644 (file)
@@ -48,7 +48,8 @@ const PAGE_SWITCH_TRESHOLD = 0.2;
 const PAGE_SWITCH_TIME = 0.3;
 
 function _isTerminal(app) {
-    return app.get_app_info().get_categories().indexOf('TerminalEmulator') > -1;
+    let categories = app.get_app_info().get_categories() || [];
+    return categories.indexOf('TerminalEmulator') > -1;
 }
 
 // Recursively load a GMenuTreeDirectory; we could put this in ShellAppSystem too